//package com.lifeng.controller;
//
//import com.lifeng.es.client.TransportClientService;
//import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
//import org.elasticsearch.action.delete.DeleteResponse;
//import org.elasticsearch.action.get.GetResponse;
//import org.elasticsearch.action.index.IndexResponse;
//import org.elasticsearch.action.update.UpdateResponse;
//import org.elasticsearch.index.reindex.BulkByScrollResponse;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//
///**
// * Created by lifeng on 2019/4/26.
// */
//@RestController
//public class ESController {
//    @Resource
//    private TransportClientService clientService;
//
//    @RequestMapping("/createindexandmap")
//    @ResponseBody
//    public CreateIndexResponse createindexAndMap(String index, String type) throws Exception {
//        return clientService.createIndexAndMapping(index,type);
//    }
//
//    @RequestMapping("/createindexanddata")
//    @ResponseBody
//    public IndexResponse createindexAndData(String index, String type) throws Exception {
//        return clientService.createIndexAndAddData(index,type);
//    }
//
//    @RequestMapping("/deleteById")
//    @ResponseBody
//    public DeleteResponse deleteById(String index, String type,String id) throws Exception {
//        return clientService.deleteById(index,type,id);
//    }
//
//    @RequestMapping("/deleteByQueryString")
//    @ResponseBody
//    public BulkByScrollResponse deleteByQueryString(String index) throws Exception {
//        return clientService.deleteByQueryString(index);
//    }
//
//    @RequestMapping("/update")
//    @ResponseBody
//    public UpdateResponse update(String index,String type,String id) throws Exception {
//        return clientService.update(index,type,id);
//    }
//
//    @RequestMapping("/getById")
//    @ResponseBody
//    public GetResponse getById(String index, String type, String id) throws Exception {
//        return clientService.getById(index,type,id);
//    }
//
//}
